home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
hisoft
/
const.lha
/
const
/
constant-ize.doc
< prev
next >
Wrap
Text File
|
1995-12-19
|
2KB
|
48 lines
============
Constant-Ize
============
Ultra small program for converting lists of things into constant lists for
HiSoft Basic 2, a bit like enums, but const is much nicer :-)
First make a nice list of anything you want to turn into a list of stuff.
This list can contain anything, but make sure it is all valid as variable
names. You do not need to include any nasty '%' signs. I really hate
typing them.
Then run 'constant-ize <filename>' and a few seconds later you will suddenly
have a couple of new files in the same directory.
'<filename>_h.bas' is the real file of usefullness. It contains the list of
constants you want to include in your program. You can then do stuff
without remembering tedious stuff like offsets.
'<filename>_sub.bas' is a quick subroutine that may come in handy. I like
loading a string array with the same contents as the constants so I can
print what it is without doing a million 'if' statements.
I have included a quick sample about cars.
<cars> The source file containing all those interesting
vehicles
<cars_h.bas> Generated constant files
<cars_sub.bas> generated subroutine to load up the cars into an
array.
I hope you find this program usefull, I know I do a LOT of this sort of
thing, and have been continuously alarmed by the lack of good code
generating utilities for HBasic2. The only other one I know of at this time
is 'ConvertiILBM' by Massimo Tantignone, which converts iff files into
something more usable. 'aminet/gfx/conv/c_ilbm21.lha' If you have any cool
code generators, please upload them. Please send me the url as well !
_ _ _ _ _ _ | Ferengi Rule of Acquisition #202
|_> |_| |_| |\ | |_ | | | / | |
|_> | \ | | | \| |_ |_ |_| \_ . | The justification for profit is profit.
|
Please email me at: Braneloc@mirex.demon.co.uk
Alternative email: Braneloc@draught.demon.co.uk (DraughtFlow BBS,
01707 328484, free internet email, 9 CD's online, no download limit..)